home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume2 / final-xenix-smail < prev    next >
Encoding:
Internet Message Format  |  1991-08-07  |  22.2 KB

  1. From: chip@ateng.UUCP (Chip Salzenberg)
  2. Newsgroups: comp.sources.misc
  3. Subject: v02i032: Smail 2.5 patches for Xenix -- finally!
  4. Message-ID: <7157@ncoast.UUCP>
  5. Date: 30 Jan 88 22:23:45 GMT
  6. Approved: allbery@ncoast.UUCP
  7.  
  8. Comp.sources.misc: Volume 2, Issue 32
  9. Submitted-By: Chip Salzenberg <chip@ateng.UUCP>
  10. Archive-Name: final-xenix-smail
  11.  
  12. [I sat on these for a bit, this being the fourth "final" version I've received.
  13. Looks like this time it's for keeps.  ++bsa]
  14.  
  15. Okay, here it is (finally).  Patches for using Smail under SCO Xenix.
  16. Many people have got smail running under Xenix, but their schemes usually
  17. break Micnet mail and ignore pipe aliases as supported by the standard
  18. Xenix mail system.  My patches don't replace Xenix mail, they work with it.
  19.  
  20. And besides, they look nice.  :-)
  21.  
  22. So here's the sharchive.  "Shar and enjoy."
  23.  
  24. #! /bin/sh
  25. # This is a shell archive, meaning:
  26. # 1. Remove everything above the "#! /bin/sh" line.
  27. # 2. Save the resulting text in a file.
  28. # 3. Execute the file with /bin/sh (not csh) to create the files:
  29. #    X.README
  30. #    X.patches
  31. #    Makefile
  32. #    execm.c
  33. #    install_smail
  34. # This archive created: Thu Jan  7 13:58:34 1988
  35. export PATH; PATH=/bin:$PATH
  36. :
  37. echo 'shar: extracting "X.README" (4621 characters) '
  38. if test -f 'X.README'
  39. then
  40.     echo 'shar: will not overwrite existing file "X.README" '
  41. else
  42. sed 's/^X//' << \SHAR_EOF > 'X.README'
  43. XX.README
  44. X
  45. XThis file describes how to use the enclosed smail 2.5 patches for SCO Xenix
  46. XSystem V.  (They may work with non-SCO Xenix.)
  47. X
  48. XTo use these patches, you need either (1) Larry Wall's "patch" program, or
  49. X(2) lots of patience while you apply these changes by hand.
  50. X
  51. X
  52. XFor users of my earlier smail patches:
  53. X
  54. X    I posted some early smail patches in comp.unix.xenix and
  55. X    alt.sources in December '87.  If you are using those patches, you
  56. X    should get rid of them and USE THESE PATCHES INSTEAD.
  57. X
  58. X    Why?
  59. X
  60. X    1.  Cleaner mods (only important things have been changed).
  61. X    2.  Better comments.
  62. X    3.  Explicit support for Micnet/Xenix-Net.
  63. X    4.  Support for /etc/systemid file (no need to relink your
  64. X        kernel to change your machine name).
  65. X
  66. X
  67. XInstallation:
  68. X
  69. X    1.  Find your original, untouched smail 2.5 sources.  Copy these
  70. X        to a new directory.  (We'll call it "/usr/src/xsmail".)
  71. X        If you don't have your original sources, some (or many!)
  72. X        patches may fail, possibly introducing problems.
  73. X
  74. X    2.  Unpack this sharchive and move the files in this sharchive into
  75. X        /usr/src/xsmail.  This will overwrite the distributed Makefile,
  76. X        so you may want to rename the original Makefile first.
  77. X
  78. X    3.  Change to /usr/src/xsmail and run "patch <X.patches".  This
  79. X        does the hard work of changing source files.
  80. X
  81. X        This step will leave ".orig" files lying around.  You may
  82. X        remove these at any time, but I'd leave them until installation
  83. X        is complete just to be on the safe side.  If any patches fail
  84. X        -- which should only occur if you're starting with modfied
  85. X        sources -- the failed patches will be written to ".rej" files.
  86. X
  87. X    4.  Examine defs.h and modify it as necessary for your machine(s).
  88. X        Specifically, if you're running Micnet or Xenix-Net, you'll
  89. X        probably want to uncomment "#define MICNET". (Or you can
  90. X        include "-DMICNET" in the CFLAGS in the Makefile.)
  91. X
  92. X    5.  Run "make" to make smail and execm, or if you prefer, run
  93. X        "make all".
  94. X
  95. X    6.  >As root<, run "./install_smail".
  96. X
  97. X
  98. XThe above steps should result in:
  99. X
  100. X    /usr/bin/rmail moved to /usr/bin/rmail.x and never used again.
  101. X
  102. X    Smail installed as /usr/bin/smail with a link to /usr/bin/rmail.
  103. X
  104. X    /usr/lib/mail/execmail moved to /usr/lib/mail/execmail.x.  Smail
  105. X    then uses execmail.x for delivering local mail. (If you compile
  106. X    smail with MICNET defined, then execmail.x is used for delivering
  107. X    _all_ mail, not just local mail.)
  108. X
  109. X    The program execm.c installed as /usr/lib/mail/execmail.  This
  110. X    "fake" execmail just parses its arguments and overlays itself with
  111. X    smail, which does all the work. (The /bin/mail program uses
  112. X    execmail, so we can't ignore it.  I would have just linked
  113. X    /usr/bin/smail to /usr/lib/mail/execmail, but their arguments are
  114. X    different.)
  115. X
  116. X
  117. XNotes on aliasing:
  118. X
  119. X    The normal Xenix aliasing mechanism is still intact. (You know,
  120. X    /usr/lib/aliases, maliases, and faliases.) In addition, smail
  121. X    aliases using the file /usr/lib/mail/saliases.  This file has a
  122. X    format which is almost, but not quite, entirely unlike the Xenix
  123. X    aliases file.  See the smail "aliases.c" for some hints.  The main
  124. X    difference is that you can include a name in parentheses after the
  125. X    alias:
  126. X
  127. X        postmaster:     chip                    (mail administrator)
  128. X        rick:           rick@uunet.uu.net       (Rick Adams)
  129. X
  130. X    The nice thing about having two alias files is that smail's aliases
  131. X    can be internet-style addresses ("user@domain"), and execmail's
  132. X    aliases can be pipes ("|/usr/lib/news/uurec").  If you use Micnet,
  133. X    the network utilities will stomp on the Xenix aliases file but
  134. X    leave the saliases file untouched.
  135. X
  136. X
  137. XNotes on the use of /bin/mail:
  138. X
  139. X    If you want to use Internet-style addresses with /bin/mail, you
  140. X    have to add the line "set execmail" to /usr/lib/mail/mailrc.
  141. X    Otherwise, /bin/mail assumes that addresses without bangs must be
  142. X    valid local users.  Of course, you can use the bang notation with
  143. X    domains and /bin/mail will always be happy.
  144. X
  145. X    If you do any significant amount of mail work, forget /bin/mail and
  146. X    use Elm.  It's the best thing since System V.  :-)
  147. X
  148. X
  149. XOne final comment:
  150. X
  151. X    I'd like to have some idea of how widely used these patches are.
  152. X    So when you get it working -- or if you can't! -- drop me a line
  153. X    and tell me about it. (My address is ateng!chip.  If you can't find
  154. X    a valid path, try going through codas or uunet.)
  155. X
  156. X
  157. XObligatory quote:
  158. X
  159. X    "INVESTIGATE your point of view, don't just dogmatize it!
  160. X    Reflect on it and re-evaluate it.  You may want to change
  161. X    your mind someday."
  162. X                -- Tim Reingold, from alt.flame
  163. X
  164. XSignature:
  165. X
  166. X    Chip Salzenberg <chip@ateng.UUCP>
  167. X    A T Engineering, Tampa, FL
  168. X    06 January 1988
  169. SHAR_EOF
  170. if test 4621 -ne `wc -c < 'X.README'`
  171. then
  172.     echo 'shar: error transmitting "X.README" (should have been 4621 characters) '
  173. fi
  174. chmod 644 'X.README'
  175. fi  # end of overwriting check
  176. :
  177. echo 'shar: extracting "X.patches" (10980 characters) '
  178. if test -f 'X.patches'
  179. then
  180.     echo 'shar: will not overwrite existing file "X.patches" '
  181. else
  182. sed 's/^X//' << \SHAR_EOF > 'X.patches'
  183. XIndex: alias.c
  184. X*** smail2.5/alias.c    Mon Dec 21 18:29:55 1987
  185. X--- smail/alias.c    Thu Sep 24 13:00:56 1987
  186. X***************
  187. X*** 460,462 ****
  188. X  
  189. X!     while((*p != NULL) && (*p != '#')) {
  190. X          b = p;
  191. X--- 460,462 ----
  192. X  
  193. X!     while((*p != '\0') && (*p != '#')) {
  194. X          b = p;
  195. XIndex: defs.h
  196. X*** smail2.5/defs.h    Mon Dec 21 18:29:57 1987
  197. X--- smail/defs.h    Wed Dec 30 11:30:40 1987
  198. X***************
  199. X*** 18,19 ****
  200. X--- 18,47 ----
  201. X  
  202. X+ /*
  203. X+ **    Modified for SCO Xenix by Chip Salzenberg (chip@ateng.UUCP).
  204. X+ **    Released to Usenet on 01 Dec 1987.
  205. X+ **    Further modified 23 Dec 1987.
  206. X+ **
  207. X+ **    Additions:
  208. X+ **
  209. X+ **        EXECMAIL is defined as the renamed /usr/lib/mail/execmail.
  210. X+ **        Under Xenix, this is the local delivery agent.
  211. X+ **
  212. X+ **        SMARTMAILER is now automatically defined if either SENDMAIL
  213. X+ **        or EXECMAIL is defined.  This is useful for code that depends
  214. X+ **        on properties that these programs have in common (automatic
  215. X+ **        bouncing of failed mail, for example).
  216. X+ **
  217. X+ **        MICNET should be defined if Micnet or Xenix-Net is in use.
  218. X+ **        In this case, execmail is used for _all_ mail, which allows
  219. X+ **        the automatic routing of UUCP mail to a gateway.  However,
  220. X+ **        execmail sends one file per recipient, even if the recipients
  221. X+ **        are all on the same (remote) machine.  This is not exactly
  222. X+ **        a bug; it just increases UUCP connect time.  I personally
  223. X+ **        leave MICNET undefined.
  224. X+ **
  225. X+ **        HOSTFILE is the name of a file containing the hostname.
  226. X+ **        Under Xenix, this is "/etc/systemid".  HOSTFILE overrides
  227. X+ **        UNAME/GETHOSTNAME.
  228. X+ */
  229. X+ 
  230. X  #ifndef VERSION
  231. X***************
  232. X*** 32,34 ****
  233. X  
  234. X! /* if defined, HOSTNAME overrides UNAME and GETHOSTNAME */
  235. X  /*#define HOSTNAME    "host"        /* literal name */
  236. X--- 60,69 ----
  237. X  
  238. X! /* if defined, HOSTFILE overrides UNAME and GETHOSTNAME */
  239. X! #ifndef HOSTFILE
  240. X! #ifdef M_XENIX
  241. X! #define HOSTFILE    "/etc/systemid"    /* read host name from this file */
  242. X! #endif
  243. X! #endif
  244. X! 
  245. X! /* if defined, HOSTNAME overrides HOSTFILE, UNAME, and GETHOSTNAME */
  246. X  /*#define HOSTNAME    "host"        /* literal name */
  247. X***************
  248. X*** 105,107 ****
  249. X  
  250. X! #define ALIAS    "/usr/lib/aliases"    /* location of mail aliases       */
  251. X  /*#define CASEALIAS            /* make aliases case sensitive    */
  252. X--- 140,147 ----
  253. X  
  254. X!     /* Location of mail aliases */
  255. X! #ifdef M_XENIX
  256. X! #define ALIAS   "/usr/lib/mail/saliases"
  257. X! #else
  258. X! #define ALIAS   "/usr/lib/aliases"
  259. X! #endif
  260. X  /*#define CASEALIAS            /* make aliases case sensitive    */
  261. X***************
  262. X*** 125,126 ****
  263. X--- 165,170 ----
  264. X  
  265. X+     /* list of Full Name, address pairs */
  266. X+ #ifdef M_XENIX
  267. X+ #define FULLNAME        "/usr/lib/mail/fullnames"
  268. X+ #else
  269. X  #define FULLNAME    "/usr/lib/fullnames"
  270. X***************
  271. X*** 126,128 ****
  272. X  #define FULLNAME    "/usr/lib/fullnames"
  273. X!                     /* list of Full Name, address pairs */
  274. X  
  275. X--- 170,172 ----
  276. X  #define FULLNAME    "/usr/lib/fullnames"
  277. X! #endif
  278. X  
  279. X***************
  280. X*** 144,146 ****
  281. X  
  282. X! /*#define LOG    "/usr/spool/uucp/mail.log"    /* log of uucp mail */
  283. X  /*#define RECORD    "/tmp/mail.log"        /* record of uucp mail */
  284. X--- 188,190 ----
  285. X  
  286. X! #define LOG    "/usr/spool/uucp/mail.log"    /* log of uucp mail */
  287. X  /*#define RECORD    "/tmp/mail.log"        /* record of uucp mail */
  288. X***************
  289. X*** 162,165 ****
  290. X  
  291. X! #ifndef SMAIL
  292. X! #define SMAIL        "/bin/smail"    /* location of smail command */
  293. X  #endif
  294. X--- 206,212 ----
  295. X  
  296. X! #ifndef SMAIL       /* location of smail command */
  297. X! #ifdef M_XENIX
  298. X! #define SMAIL        "/usr/bin/smail"
  299. X! #else
  300. X! #define SMAIL        "/bin/smail"
  301. X  #endif
  302. X***************
  303. X*** 165,166 ****
  304. X--- 212,214 ----
  305. X  #endif
  306. X+ #endif
  307. X  
  308. X***************
  309. X*** 179,182 ****
  310. X  
  311. X! #define RMAIL(flags,from,sys) "%s -a%s %s - %s!rmail",UUX,from,flags,sys /* */
  312. X! /*#define RMAIL(flags,from,sys) "%s %s - %s!rmail",UUX,flags,sys /* */
  313. X  
  314. X--- 227,230 ----
  315. X  
  316. X! /*#define RMAIL(flags,from,sys) "%s -a%s %s - %s!rmail",UUX,from,flags,sys /* */
  317. X! #define RMAIL(flags,from,sys) "%s %s - %s!rmail",UUX,flags,sys /* */
  318. X  
  319. X***************
  320. X*** 187,188 ****
  321. X--- 235,238 ----
  322. X  
  323. X+     /* We're letting sendmail do lots of work for us. */
  324. X+ 
  325. X  #define HANDLE    JUSTUUCP    /* see HANDLE definition below */
  326. X***************
  327. X*** 195,197 ****
  328. X  
  329. X! #else
  330. X  
  331. X--- 245,247 ----
  332. X  
  333. X! #else  /* !SENDMAIL */
  334. X  
  335. X***************
  336. X*** 197,200 ****
  337. X  
  338. X! #define HANDLE    ALL
  339. X! #define ROUTING JUSTDOMAIN
  340. X  
  341. X--- 247,249 ----
  342. X  
  343. X!     /* We don't have sendmail, so we'll do the work ourselves. */
  344. X  
  345. X***************
  346. X*** 200,205 ****
  347. X  
  348. X! #ifdef BSD
  349. X! #define LMAIL(frm,sys)        "/bin/mail"    /* BSD local delivery agent */
  350. X! #else
  351. X! #define LMAIL(frm,sys)        "/bin/lmail"    /* SV  local delivery agent */
  352. X  #endif
  353. X--- 249,255 ----
  354. X  
  355. X! #define HANDLE  ALL             /* see HANDLE definition below */
  356. X! #define ROUTING ALWAYS          /* see ROUTING definition below */
  357. X! 
  358. X! #ifdef BSD              /* BSD local delivery agent */
  359. X! #define LMAIL(frm,sys)          "/bin/mail"
  360. X  #endif
  361. X***************
  362. X*** 206,207 ****
  363. X--- 256,267 ----
  364. X  
  365. X+ #ifdef M_XENIX          /* Xenix local delivery agent (renamed) */
  366. X+ #define EXECMAIL                "/usr/lib/mail/execmail.x"
  367. X+ #define LMAIL(frm,sys)          "%s -m -f '%s'",EXECMAIL,frm
  368. X+ /*#define MICNET                  /* give all mail to execmail, never uux */
  369. X+ #endif
  370. X+ 
  371. X+ #ifndef LMAIL           /* Default local delivery agent */
  372. X+ #define LMAIL(frm,sys)          "/bin/lmail"
  373. X+ #endif
  374. X+ 
  375. X  #define LARG(user)        " '%s'",postmaster(user)
  376. X***************
  377. X*** 210,211 ****
  378. X--- 270,280 ----
  379. X  
  380. X+ #endif  /* !SENDMAIL */
  381. X+ 
  382. X+ /* Sendmail and Execmail are "smart" mailers */
  383. X+ #ifdef SENDMAIL
  384. X+ #define SMARTMAILER
  385. X+ #endif
  386. X+ 
  387. X+ #ifdef EXECMAIL
  388. X+ #define SMARTMAILER
  389. X  #endif
  390. XIndex: deliver.c
  391. X*** smail2.5/deliver.c    Mon Dec 21 18:29:59 1987
  392. X--- smail/deliver.c    Wed Dec 23 12:19:33 1987
  393. X***************
  394. X*** 7,8 ****
  395. X--- 7,24 ----
  396. X  
  397. X+ /*
  398. X+ **    Modified for SCO Xenix by Chip Salzenberg (chip@ateng.UUCP).
  399. X+ **    Released to Usenet on 01 Dec 1987.
  400. X+ **    Further modified 23 Dec 1987.
  401. X+ **
  402. X+ **    Additions:
  403. X+ **
  404. X+ **        If MICNET is defined, then LMAIL (execmail) is used to
  405. X+ **        deliver all mail, even remote mail.  See defs.h for a
  406. X+ **        discussion of the tradeoffs of this feature.
  407. X+ **
  408. X+ **        Some #ifdefs are now SMARTMAILER instead of SENDMAIL.
  409. X+ **        This is because execmail has some of the intelligent
  410. X+ **        features of sendmail, i.e. automatic mail return.
  411. X+ */
  412. X+ 
  413. X  #ifndef lint
  414. X***************
  415. X*** 219,222 ****
  416. X              command = scommand;
  417. X-         } else if (form == LOCAL) {
  418. X-             command = lcommand;
  419. X          } else {
  420. X--- 235,236 ----
  421. X***************
  422. X*** 222,226 ****
  423. X          } else {
  424. X!             command = rcommand;
  425. X!             if(flags == uux_noqueue) {
  426. X!                 noqcnt++;
  427. X              }
  428. X--- 236,250 ----
  429. X          } else {
  430. X! #ifdef MICNET
  431. X!             /* Xenix system running Micnet -- let execmail
  432. X!              * handle all messages except retries.
  433. X!              */
  434. X!             command = lcommand;
  435. X! #else
  436. X!             if (form == LOCAL) {
  437. X!                 command = lcommand;
  438. X!             } else {
  439. X!                 command = rcommand;
  440. X!                 if(flags == uux_noqueue) {
  441. X!                     noqcnt++;
  442. X!                 }
  443. X              }
  444. X***************
  445. X*** 226,227 ****
  446. X--- 250,252 ----
  447. X              }
  448. X+ #endif
  449. X          }
  450. X***************
  451. X*** 271,273 ****
  452. X          if (form == LOCAL) {
  453. X! #ifdef SENDMAIL
  454. X              (void) sprintf(buf, LFROM(from, nows, hostname));
  455. X--- 296,298 ----
  456. X          if (form == LOCAL) {
  457. X! #ifdef SMARTMAILER
  458. X              (void) sprintf(buf, LFROM(from, nows, hostname));
  459. X***************
  460. X*** 283,285 ****
  461. X              } else {
  462. X!                 *p = NULL;
  463. X                  (void) sprintf(buf, RFROM(p+1, nows, from));
  464. X--- 308,310 ----
  465. X              } else {
  466. X!                 *p = '\0';
  467. X                  (void) sprintf(buf, RFROM(p+1, nows, from));
  468. X***************
  469. X*** 372,378 ****
  470. X                      (void) fseek(spoolfp, message, 0);
  471. X! #ifdef SENDMAIL
  472. X!                     /* if we have sendmail, then it
  473. X!                     ** was handed the mail, which failed.
  474. X!                     ** sendmail returns the failed mail
  475. X!                     ** for us, so we need not do it again.
  476. X                      */
  477. X--- 397,402 ----
  478. X                      (void) fseek(spoolfp, message, 0);
  479. X! #ifdef SMARTMAILER
  480. X!                     /* Mail is automatically returned
  481. X!                     ** by sendmail and execmail, so we
  482. X!                     ** need not do it again.
  483. X                      */
  484. XIndex: headers.c
  485. X*** smail2.5/headers.c    Mon Dec 21 18:30:06 1987
  486. X--- smail/headers.c    Wed Dec 23 12:26:43 1987
  487. X***************
  488. X*** 5,6 ****
  489. X--- 5,18 ----
  490. X  
  491. X+ /*
  492. X+ **    Modified for SCO Xenix by Chip Salzenberg (chip@ateng.UUCP).
  493. X+ **    Released to Usenet on 01 Dec 1987.
  494. X+ **    Further modified 23 Dec 1987.
  495. X+ **
  496. X+ **    Additions:
  497. X+ **
  498. X+ **        Understand "a%b" to mean "a@b".  (This is a judgement call.
  499. X+ **        I prefer to accept any mail that I can understand, not just
  500. X+ **        that which is "correct.")
  501. X+ */
  502. X+ 
  503. X  #ifndef lint
  504. X***************
  505. X*** 155,156 ****
  506. X--- 167,179 ----
  507. X      }
  508. X+ /*
  509. X+ **  Try splitting at %.  If it works, this is user%domain, which we choose
  510. X+ **  to understand as user@domain.  Prefer the righthand % in a%b%c.
  511. X+ **  (This code allows 'user%foo@mydom' to mean '@mydom,user@foo'.)
  512. X+ */
  513. X+     if ((parts = ssplit(address, '%', partv)) >= 2) {
  514. X+         (void) strcpy(domain, partv[parts-1]);
  515. X+         (void) strncpy(user, partv[0], partv[parts-1]-partv[0]-1);
  516. X+         user[partv[parts-1]-partv[0]-1] = '\0';
  517. X+         return (DOMAIN);
  518. X+     } 
  519. X  /* 
  520. XIndex: misc.c
  521. X*** smail2.5/misc.c    Mon Dec 21 18:30:19 1987
  522. X--- smail/misc.c    Wed Dec 23 12:30:02 1987
  523. X***************
  524. X*** 5,6 ****
  525. X--- 5,21 ----
  526. X  
  527. X+ /*
  528. X+ **    Modified for SCO Xenix by Chip Salzenberg (chip@ateng.UUCP).
  529. X+ **    Released to Usenet on 01 Dec 1987.
  530. X+ **    Further modified 23 Dec 1987.
  531. X+ **
  532. X+ **    Additions:
  533. X+ **
  534. X+ **        If HOSTFILE is defined, read it to look for the hostname.
  535. X+ **        (This file is typically "/etc/systemid" on Xenix systems.)
  536. X+ **        If HOSTFILE is missing, try uname() or gethostname().
  537. X+ **
  538. X+ **        Write only the basename of the program in the log file,
  539. X+ **        just to make the log file easier to read.
  540. X+ */
  541. X+ 
  542. X  #ifndef lint
  543. X***************
  544. X*** 53,57 ****
  545. X  
  546. X!     logtime = strcpy(tbuf, nows);
  547. X!     logtime[16] = '\0';
  548. X!     logtime += 4;
  549. X  
  550. X--- 68,75 ----
  551. X  
  552. X!     /* To make the log file look nicer, show only the basename of
  553. X!      * the command.
  554. X!      */
  555. X!     if (*command == '/')
  556. X!     {
  557. X!         char *p, *ecmd;
  558. X  
  559. X***************
  560. X*** 57,58 ****
  561. X--- 75,92 ----
  562. X  
  563. X+         if ( (ecmd = index(command, ' ')) != 0 )
  564. X+             *ecmd = '\0';
  565. X+ 
  566. X+         if ( (p = rindex(command, '/')) != 0 )
  567. X+             command = p + 1;
  568. X+ 
  569. X+         if ( ecmd != 0 )
  570. X+             *ecmd = ' ';
  571. X+     }
  572. X+ 
  573. X+     /* Time (now).
  574. X+      */
  575. X+     strcpy(tbuf, nows);
  576. X+     tbuf[16] = '\0';
  577. X+     logtime = &tbuf[4];
  578. X+ 
  579. X      cmask = umask(0);
  580. X***************
  581. X*** 313,314 ****
  582. X--- 347,363 ----
  583. X          (void) strcpy(hostname, HOSTNAME);
  584. X+ #endif
  585. X+ #ifdef HOSTFILE
  586. X+     if (!*hostname) {
  587. X+         FILE *fp;
  588. X+         char *p;
  589. X+ 
  590. X+         if ((fp = fopen(HOSTFILE, "r")) != NULL) {
  591. X+             if (fgets(hostname, SMLBUF - 1, fp) != NULL
  592. X+              && (p = index(hostname, '\n')) != NULL)
  593. X+                 *p = '\0';
  594. X+             else
  595. X+                 *hostname = '\0';
  596. X+             fclose(fp);
  597. X+         }
  598. X+     }
  599. X  #endif
  600. XIndex: nptx.c
  601. X*** smail2.5/nptx.c    Mon Dec 21 18:30:20 1987
  602. X--- smail/nptx.c    Thu Sep 24 13:07:13 1987
  603. X***************
  604. X*** 127,129 ****
  605. X          (void) strcpy(nl[i], p+1);
  606. X!         *p = NULL;
  607. X      }
  608. X--- 127,129 ----
  609. X          (void) strcpy(nl[i], p+1);
  610. X!         *p = '\0';
  611. X      }
  612. X***************
  613. X*** 164,166 ****
  614. X              (void) strcpy(il[ii], pi+1);
  615. X!             *pi = NULL;
  616. X          }
  617. X--- 164,166 ----
  618. X              (void) strcpy(il[ii], pi+1);
  619. X!             *pi = '\0';
  620. X          }
  621. SHAR_EOF
  622. if test 10980 -ne `wc -c < 'X.patches'`
  623. then
  624.     echo 'shar: error transmitting "X.patches" (should have been 10980 characters) '
  625. fi
  626. chmod 644 'X.patches'
  627. fi  # end of overwriting check
  628. :
  629. echo 'shar: extracting "Makefile" (1427 characters) '
  630. if test -f 'Makefile'
  631. then
  632.     echo 'shar: will not overwrite existing file "Makefile" '
  633. else
  634. sed 's/^X//' << \SHAR_EOF > 'Makefile'
  635. X# Makefile for smail
  636. X# @(#)Makefile    2.5 (smail) 9/15/87
  637. X#
  638. X# Modified for SCO Xenix by Chip Salzenberg <chip@ateng.UUCP>.
  639. X# Released to Usenet on 01 Dec 1987.
  640. X# Fixed as per comments of Chris Lewis <uunet!mnetor!spectrix!clewis>.
  641. X#
  642. X# With the addition of the `xenix' pseudo-target, this makefile now makes
  643. X# both smail and execm by default.
  644. X#
  645. X# Use the `install_smail' script to install the resulting binaries.
  646. X
  647. XCFLAGS    = -O
  648. XLDFLAGS = -i
  649. XSHELL    = /bin/sh
  650. XCOPY    = copy -om
  651. X
  652. X#
  653. X# System V Release 2.0 sites can use -lmalloc for a faster malloc
  654. X#
  655. X#LIBS    =    -lmalloc
  656. X
  657. XOBJECTS =    main.o map.o resolve.o deliver.o misc.o alias.o pw.o headers.o getpath.o str.o getopt.o
  658. X
  659. Xxenix:  smail execm
  660. Xall:    smail svbinmail lcasep pathproc mkfnames nptx execm
  661. X
  662. Xsmail:        $(OBJECTS)
  663. X        $(CC) $(LDFLAGS) -F 4000 $(OBJECTS) -o smail $(LIBS)
  664. X
  665. X$(OBJECTS):    defs.h
  666. X        $(CC) $(CFLAGS) -c $<
  667. X
  668. Xexecm:          execm.c
  669. X        $(CC) $(CFLAGS) $(LDFLAGS) execm.c -o execm
  670. X
  671. Xsvbinmail:    svbinmail.c defs.h
  672. X        $(CC) $(CFLAGS) $(LDFLAGS) svbinmail.c -o svbinmail
  673. X
  674. Xlcasep:        lcasep.c
  675. X        $(CC) $(CFLAGS) $(LDFLAGS) lcasep.c -o lcasep
  676. X
  677. Xpathproc:    pathproc.sh
  678. X        $(COPY) pathproc.sh pathproc
  679. X        chmod 755 pathproc
  680. X
  681. Xmkfnames:    mkfnames.sh
  682. X        $(COPY) mkfnames.sh mkfnames
  683. X        chmod 755 mkfnames
  684. X
  685. Xnptx:        nptx.o pw.o str.o
  686. X        $(CC) $(CFLAGS) nptx.o pw.o str.o -o nptx $(LIBS)
  687. X
  688. Xclean:
  689. X        rm -f *.o *.ln a.out core
  690. X
  691. Xclobber:    clean
  692. X        rm -f smail rmail lcasep pathproc mkfnames svbinmail nptx execm
  693. SHAR_EOF
  694. if test 1427 -ne `wc -c < 'Makefile'`
  695. then
  696.     echo 'shar: error transmitting "Makefile" (should have been 1427 characters) '
  697. fi
  698. chmod 644 'Makefile'
  699. fi  # end of overwriting check
  700. :
  701. echo 'shar: extracting "execm.c" (747 characters) '
  702. if test -f 'execm.c'
  703. then
  704.     echo 'shar: will not overwrite existing file "execm.c" '
  705. else
  706. sed 's/^X//' << \SHAR_EOF > 'execm.c'
  707. X/*
  708. X * execm.c
  709. X *
  710. X * This program is a substitute for Xenix's /usr/lib/mail/execmail.
  711. X *
  712. X * Written by Chip Salzenberg (chip@ateng.UUCP).
  713. X * Released to Usenet on 01 Dec 1987.
  714. X *
  715. X * Do what you want with it; I'm not responsible for lost mail,
  716. X * but I don't expect that this little program will lose anything.
  717. X */
  718. X
  719. X#include <stdio.h>
  720. X
  721. Xmain(argc, argv)
  722. Xint     argc;
  723. Xchar    **argv;
  724. X{
  725. X    char *progname = argv[0];
  726. X
  727. X    /*
  728. X     * Drop the execmail options.
  729. X     */
  730. X    while (argv[1][0] == '-')
  731. X    {
  732. X        switch (argv[1][1])
  733. X        {
  734. X        case 'f':
  735. X        case 'h':
  736. X            argv += 2;
  737. X            break;
  738. X        default:
  739. X            ++argv;
  740. X            break;
  741. X        }
  742. X    }
  743. X
  744. X    argv[0] = progname;
  745. X    execv("/usr/bin/smail", argv);
  746. X    execv("/bin/smail", argv);
  747. X
  748. X    fprintf(stderr, "%s: can't execute smail!\n", progname);
  749. X    exit(1);
  750. X}
  751. SHAR_EOF
  752. if test 747 -ne `wc -c < 'execm.c'`
  753. then
  754.     echo 'shar: error transmitting "execm.c" (should have been 747 characters) '
  755. fi
  756. chmod 644 'execm.c'
  757. fi  # end of overwriting check
  758. :
  759. echo 'shar: extracting "install_smail" (1137 characters) '
  760. if test -f 'install_smail'
  761. then
  762.     echo 'shar: will not overwrite existing file "install_smail" '
  763. else
  764. sed 's/^X//' << \SHAR_EOF > 'install_smail'
  765. X: install_smail
  766. X# Shell script to install smail in a Xenix System V system.
  767. X#
  768. X# Written by Chip Salzenberg (chip@ateng.UUCP).
  769. X# Released to Usenet on 01 Dec 1987.
  770. X#
  771. X# Note that this script renames the standard Xenix rmail and execmail
  772. X# programs to rmail.x and execmail.x respectively.  If those `.x' files
  773. X# already exist, then no renaming takes place, so you can run this script
  774. X# more than once without losing those renamed programs.
  775. X#
  776. X# BTW, be sure to test everything thoroughly; a broken mail system is
  777. X# sure to upset any users on your system.
  778. X
  779. XCOPY="copy -m"
  780. XSMAIL="/usr/bin/smail"
  781. XRMAIL="/usr/bin/rmail"
  782. XEXECM="/usr/lib/mail/execmail"
  783. X
  784. Xfor f in smail execm
  785. Xdo
  786. X    if [ ! -x $f ]; then
  787. X    echo "You need to compile $f first."
  788. X    exit 1
  789. X    fi
  790. Xdone
  791. X
  792. Xecho "Installing current smail -- you have 5 seconds to abort."
  793. Xsleep 5
  794. X
  795. Xif [ ! -f $RMAIL.x ]; then
  796. X    mv $RMAIL $RMAIL.x
  797. Xfi
  798. Xrm -f $RMAIL
  799. Xif [ ! -f $EXECM.x ]; then
  800. X    mv $EXECM $EXECM.x
  801. Xfi
  802. Xrm -f $EXECM
  803. X
  804. X$COPY execm $EXECM
  805. Xchown bin $EXECM
  806. Xchgrp bin $EXECM
  807. Xchmod 755 $EXECM
  808. X
  809. Xrm -f $SMAIL $RMAIL
  810. X$COPY smail $SMAIL
  811. Xchown bin $SMAIL
  812. Xchgrp bin $SMAIL
  813. Xchmod 755 $SMAIL
  814. Xln $SMAIL $RMAIL
  815. SHAR_EOF
  816. if test 1137 -ne `wc -c < 'install_smail'`
  817. then
  818.     echo 'shar: error transmitting "install_smail" (should have been 1137 characters) '
  819. fi
  820. chmod 755 'install_smail'
  821. fi  # end of overwriting check
  822. #    End of shell archive
  823. exit 0
  824.